package ihc.terminalbanco.gui.panels;

import ihc.terminalbanco.gui.buttons.LabelButton;
import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.Font;
import java.awt.GridLayout;
import java.awt.event.ActionListener;

import javax.swing.BorderFactory;
import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTextField;
import javax.swing.border.Border;

public class SegurancaPane extends JPanel implements RotulosInterface{
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 2929713786372228855L;

	public SegurancaPane (ActionListener actionListener, Font font){
		this.setLayout(new BorderLayout());
		
		Border raisedbevel = BorderFactory.createRaisedBevelBorder();
		/*
		 * Panels
		 */
		//CENTER
				
		JPanel painelCentralSuperior = new JPanel();
		painelCentralSuperior.setLayout(new FlowLayout(FlowLayout.CENTER));
		
		JLabel senhaAdicional = new JLabel("SENHA ADICIONAL");
		senhaAdicional.setFont(font);
		painelCentralSuperior.add(senhaAdicional);
		
		JPanel painelCentralPai = new JPanel();
                
		painelCentralPai.setLayout(new GridLayout(3, 1, 0, 30));
		
		JPanel painelCentralFilhoOpcoes = new JPanel();
		painelCentralFilhoOpcoes.setLayout(new GridLayout(2, 6, 5, 5));
		
		JLabel senhaA = new JLabel("A: 4");
                senhaA.setFont(font);
		JLabel senhaB = new JLabel("B: 6");
                senhaB.setFont(font);
		JLabel senhaC = new JLabel("C: 2");
                senhaC.setFont(font);
		JLabel senhaD = new JLabel("D: 0");
                senhaD.setFont(font);
		JLabel senhaE = new JLabel("E: 5");
                senhaE.setFont(font);
		JLabel senhaF = new JLabel("F: 8");
                senhaF.setFont(font);
		JLabel senhaG = new JLabel("G: 7");
                senhaG.setFont(font);
		JLabel senhaH = new JLabel("H: 9");
                senhaH.setFont(font);
		JLabel senhaI = new JLabel("I: 1");
                senhaI.setFont(font);
		JLabel senhaJ = new JLabel("J: 3");
                senhaJ.setFont(font);
		JLabel vazio1 = new JLabel(" ");
                JLabel vazio2 = new JLabel(" ");
                
		painelCentralFilhoOpcoes.add(vazio1);
		painelCentralFilhoOpcoes.add(senhaA);
		painelCentralFilhoOpcoes.add(senhaB);
		painelCentralFilhoOpcoes.add(senhaC);
		painelCentralFilhoOpcoes.add(senhaD);
		painelCentralFilhoOpcoes.add(senhaE);
		painelCentralFilhoOpcoes.add(vazio2);
		painelCentralFilhoOpcoes.add(senhaF);
		painelCentralFilhoOpcoes.add(senhaG);
		painelCentralFilhoOpcoes.add(senhaH);
		painelCentralFilhoOpcoes.add(senhaI);
		painelCentralFilhoOpcoes.add(senhaJ);
		
				
		JPanel painelCentralFilhoNumero = new JPanel();
		painelCentralFilhoNumero.setLayout(new GridLayout(1, 2, 10, 100));
		
		painelCentralPai.add(painelCentralFilhoOpcoes);
		painelCentralPai.add(painelCentralFilhoNumero);
		
		JLabel numero = new JLabel("Número: ");
                numero.setFont(font);
		JTextField entradaNumero = new JTextField();
		
		
		painelCentralFilhoNumero.add(numero);
		painelCentralFilhoNumero.add(entradaNumero);
		
		
		painelCentralFilhoNumero.setBorder(raisedbevel);
		
        //SOUTH
        JPanel painelSul = new JPanel();
        painelSul.setLayout(new GridLayout(1, 2,100,0));

        LabelButton voltarButton = new LabelButton(encerrarString,"images/encerrar.png");
        voltarButton.setFont(font);
        voltarButton.setVisible(true);
        voltarButton.addActionListener(actionListener);
        painelSul.add(voltarButton);

        LabelButton confirmarButton = new LabelButton(confirmarString, "images/continuar.png");
        confirmarButton.setFont(font);
        confirmarButton.setVisible(true);
        confirmarButton.addActionListener(actionListener);
        painelSul.add(confirmarButton);
		
		//Juntando
		JPanel painelCentralPrincipal = new JPanel();
		painelCentralPrincipal.setLayout(new GridLayout(2, 1));
		painelCentralPrincipal.add(painelCentralSuperior);
		painelCentralPrincipal.add(painelCentralPai);
		
		this.add(painelCentralPrincipal, BorderLayout.CENTER);
		this.add(painelSul, BorderLayout.SOUTH);

		
	}

}
